package com.ktjiaoyu.crm;

import com.ktjiaoyu.crm.entity.Right;
import com.ktjiaoyu.crm.entity.Role;
import com.ktjiaoyu.crm.service.IRoleService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.util.List;

@SpringBootTest
@RunWith(SpringRunner.class)
public class RoleServiceTester {
    @Resource
    private IRoleService roleService;
    @Test
    public void testfind(){
        Role role = new Role();
        role.setRoleId(2L);
        List<Right> rights = roleService.findRightsByRole(role);

        for(Right right:rights) {
            System.out.println(right.getRightCode());
        }
    }
}
